//
//  ADJgKitLogging.h
//  ADJgKit
//
//  Created by 陈坤 on 2020/3/19.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, ADJgKitLogLevel) {
    /// No logs
    ADJgKitLogLevelOff     = 0,
    /// Error logs only. 0...00001
    ADJgKitLogLevelError   = (1 << 0),
    /// Error and warning logs, 0...00010
    ADJgKitLogLevelWarning = (1 << 1),
    /// Error, warning and info logs, 0...00100
    ADJgKitLogLevelInfo    = (1 << 2),
    /// Error, warning, info and debug logs, 0...01000
    ADJgKitLogLevelDebug   = (1 << 3),
    /// Error, warning, info, debug and verbose logs, 0...10000
    ADJgKitLogLevelVerbose = (1 << 4),
    /// All logs. 1...11111
    ADJgKitLogLevelAll     = NSUIntegerMax
};

ADJgKitLogLevel ADJgKitLogGetLevel(void);
void ADJgKitLogSetLevel(ADJgKitLogLevel level);

FOUNDATION_EXPORT void _ADJgKitLogError(NSString *format, ...);
FOUNDATION_EXPORT void _ADJgKitLogWarn(NSString *format, ...);
FOUNDATION_EXPORT void _ADJgKitLogInfo(NSString *format, ...);
FOUNDATION_EXPORT void _ADJgKitLogDebug(NSString *format, ...);
FOUNDATION_EXPORT void _ADJgKitLogVerbose(NSString *format, ...);

#ifdef DEBUG
    #define ADJgKitLogError(...)   _ADJgKitLogError(__VA_ARGS__)
    #define ADJgKitLogWarn(...)    _ADJgKitLogWarn(__VA_ARGS__)
    #define ADJgKitLogInfo(...)    _ADJgKitLogInfo(__VA_ARGS__)
    #define ADJgKitLogDebug(...)   _ADJgKitLogDebug(__VA_ARGS__)
    #define ADJgKitLogVerbose(...) _ADJgKitLogVerbose(__VA_ARGS__)
#else
    #define ADJgKitLogError(...)   _ADJgKitLogError(__VA_ARGS__)
    #define ADJgKitLogWarn(...)    _ADJgKitLogWarn(__VA_ARGS__)
    #define ADJgKitLogInfo(...)    _ADJgKitLogInfo(__VA_ARGS__)
    #define ADJgKitLogDebug(...)   _ADJgKitLogDebug(__VA_ARGS__)
    #define ADJgKitLogVerbose(...) {}
#endif
